]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
altTab: Add shortcut to quit application
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 1 Jun 2010 18:03:45 +0000 (20:03 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 9 Feb 2018 09:26:50 +0000 (09:26 +0000)
Allow to quit the currently selected application by hitting Alt-q,
similar to the OS X switcher.

https://bugzilla.gnome.org/show_bug.cgi?id=620106

js/ui/altTab.js

index a10e1433ee227079cf4a0733aa72e4fbfcf7a92d..80039cba528dd95b36fcd5b3b50630e188b4e162 100644 (file)
@@ -156,6 +156,14 @@ var AppSwitcherPopup = new Lang.Class({
                                  this._items[this._selectedIndex].cachedWindows.length);
     },
 
+    _quitApplication: function(appIndex) {
+        let appIcon = this._items[appIndex];
+        if (!appIcon)
+            return;
+
+        appIcon.app.request_quit();
+    },
+
     _keyPressHandler: function(keysym, action) {
         if (action == Meta.KeyBindingAction.SWITCH_GROUP) {
             if (!this._thumbnailsFocused)
@@ -168,6 +176,8 @@ var AppSwitcherPopup = new Lang.Class({
             this._select(this._next());
         } else if (action == Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD) {
             this._select(this._previous());
+        } else if (keysym == Clutter.q) {
+            this._quitApplication(this._selectedIndex);
         } else if (this._thumbnailsFocused) {
             if (keysym == Clutter.Left)
                 this._select(this._selectedIndex, this._previousWindow());